/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.com.foxinline.manager.pesquisar;

import br.com.foxinline.modelo.Pessoa;
import br.com.foxinline.modelo.Protesto;
import br.com.foxinline.modelo.Protocolo;
import br.com.foxinline.servico.ProtestoServico;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.PostConstruct;
import javax.ejb.EJB;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;
import javax.faces.context.FacesContext;

/**
 *
 * @author roniere
 */
@ManagedBean
@ViewScoped
public class ManagerPesquisarProtesto implements Serializable{
    
    
    @EJB
    private ProtestoServico protestoServico;
    
    private Protocolo protocolo; 
    private Protesto protesto;
    private Pessoa interessado;
    private List<Protesto> protestos;
    
    
    @PostConstruct
    public void init(){
        protesto = new Protesto();
        protocolo = new Protocolo();
        protestos = new ArrayList<Protesto>();
        
    }
    
    
    public void pesquisar(){
        protesto.setProtocolo(protocolo);
        protestos = protestoServico.pesquisar(protesto, interessado);
    }

    public Pessoa getInteressado() {
        return interessado;
    }

    public void setInteressado(Pessoa interessado) {
        this.interessado = interessado;
    }

    public Protesto getProtesto() {
        return protesto;
    }

    public void setProtesto(Protesto protesto) {
        this.protesto = protesto;
    }

    public List<Protesto> getProtestos() {
        return protestos;
    }

    public void setProtestos(List<Protesto> protestos) {
        this.protestos = protestos;
    }

    public Protocolo getProtocolo() {
        return protocolo;
    }

    public void setProtocolo(Protocolo protocolo) {
        this.protocolo = protocolo;
    }
    
    
    
}
